package com.gopay.common.domain.cbrmb;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

/**
 * 
 * @ClassName: CbRmbBankOrderDtl
 * @Description: 结算数据详情表
 * @author gd.cui
 * @date 2016年6月29日 下午3:02:26 ww.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "CB_RMB_BANK_ORDER_DTL")
public class CbRmbBankOrderDtl extends BaseEntity {

    /**
     * @Fields serialVersionUID :
     */
    private static final long serialVersionUID = 525654190660879299L;

    /**
     * 交易日期 yyyyMMdd
     */

    private String transDate;

    /**
     * 交易订单号 结算id
     */
    private String gopayOrderId;

    /**
     * 收款人名称
     */

    private String payeeName;

    /**
     * 收款人常驻国家（地区）代码，三位ISO标准码
     */

    private String payeeCountryNo;

    /**
     * 收款行名称
     */

    private String payeeBankName;

    /**
     * 收款账号
     */

    private String payeeAccountNo;

    /**
     * 收款行SWIFT CODE
     */

    private String payeeBankSwift;

    /**
     * 收款人行行号
     */

    private String payeeBankNo;

    /**
     * 交易方向，境内到境外(01)/境外到境内(02)
     */

    private String paydirection;

    /**
     * 商户到岸金额
     */

    private BigDecimal orderamt;

    /**
     * 商户到岸币种
     */

    private String ordercur;

    /**
     * 贸易类型，服务贸易/货物贸易
     */

    private String tradeType;

    /**
     * 是否保税货物项下收汇标志，Y/N
     */

    private String isbonded;

    /**
     * 汇款附言（交易摘要
     */

    private String tradeComment;

    /**
     * 交易编码
     */

    private String tradeCode;

    /**
     * 交易附言
     */

    private String tradeDesc;

    /**
     * 是否还原申报 Y/N Y：付款信息为实际付款人； N:付款信息为支付机构
     * 
     */

    private String restoreNeeded;

    // 回盘信息
    /**
     * 返回码
     */

    private String return_code;

    /**
     * 返回码说明
     */

    private String return_info;

    /**
     * RCPM申报号码
     */

    private String rcpm_no;

    /**
     * FIMS申报号码
     */

    private String fims_no;

    /**
     * 银行业务编号
     */

    private String bank_bus_no;

    /**
     * 银行手续费
     */

    private BigDecimal bank_handling;

    /**
     * 银行电报费
     */

    private BigDecimal bank_telegram;

    /**
     * 申报日期
     */

    private String report_date;

    /**
     * 实际扣款人民币金额
     */

    private BigDecimal bank_payamt;

    /**
     * 实际汇率
     */

    private BigDecimal bank_exchangerate;
    /**
     * 数据信息头 id cbbankordermessagerel orderMessageId
     */

    private int orderMessageId;

    /**
     * 报盘 回盘状态 00 报盘进行中 01 报盘完成 02报盘失败 03 回盘完成
     */

    private String state;

    /**
     * 创建时间
     */

    private Date createTime;

    /**
     * 最后更新时间
     */

    private Date lastUpdateTime;

    @Column(name = "TRANS_DATE")
    public String getTransDate() {
        return transDate;
    }

    public void setTransDate(String transDate) {
        this.transDate = transDate;
    }

    @Id
    @Column(name = "GOPAY_ORDER_ID")
    public String getGopayOrderId() {
        return gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Column(name = "PAYEE_NAME")
    public String getPayeeName() {
        // modify by qld 收款人名称也要加密
        this.payeeName = SensitiveInfoUtils.autoReencrypt(this.payeeName);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.payeeName);
    }

    public void setPayeeName(String payeeName) {
        // modify by qld 收款人名称也要加密
        this.payeeName = SensitiveInfoUtils.smartEncryptWithCheck(payeeName);
        ;
    }

    @Column(name = "PAYEE_COUNTRY_NO")
    public String getPayeeCountryNo() {
        return payeeCountryNo;
    }

    public void setPayeeCountryNo(String payeeCountryNo) {
        this.payeeCountryNo = payeeCountryNo;
    }

    @Column(name = "PAYEE_BANK_NAME")
    public String getPayeeBankName() {
        return payeeBankName;
    }

    public void setPayeeBankName(String payeeBankName) {
        this.payeeBankName = payeeBankName;
    }

    @Column(name = "PAYEE_ACCOUNT_NO")
    public String getPayeeAccountNo() {
        this.payeeAccountNo = SensitiveInfoUtils.autoReencrypt(this.payeeAccountNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.payeeAccountNo);
    }

    public void setPayeeAccountNo(String payeeAccountNo) {
        this.payeeAccountNo = SensitiveInfoUtils.smartEncryptWithCheck(payeeAccountNo);
    }

    @Column(name = "PAYEE_BANK_SWIFT")
    public String getPayeeBankSwift() {
        return payeeBankSwift;
    }

    public void setPayeeBankSwift(String payeeBankSwift) {
        this.payeeBankSwift = payeeBankSwift;
    }

    @Column(name = "PAYEE_BANK_NO")
    public String getPayeeBankNo() {
        return payeeBankNo;
    }

    public void setPayeeBankNo(String payeeBankNo) {
        this.payeeBankNo = payeeBankNo;
    }

    @Column(name = "PAYDIRECTION")
    public String getPaydirection() {
        return paydirection;
    }

    public void setPaydirection(String paydirection) {
        this.paydirection = paydirection;
    }

    @Column(name = "ORDERAMT")
    public BigDecimal getOrderamt() {
        return orderamt;
    }

    public void setOrderamt(BigDecimal orderamt) {
        this.orderamt = orderamt;
    }

    @Column(name = "ORDERCUR")
    public String getOrdercur() {
        return ordercur;
    }

    public void setOrdercur(String ordercur) {
        this.ordercur = ordercur;
    }

    @Column(name = "TRADE_TYPE")
    public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    @Column(name = "ISBONDED")
    public String getIsbonded() {
        return isbonded;
    }

    public void setIsbonded(String isbonded) {
        this.isbonded = isbonded;
    }

    @Column(name = "TRADE_COMMENT")
    public String getTradeComment() {
        return tradeComment;
    }

    public void setTradeComment(String tradeComment) {
        this.tradeComment = tradeComment;
    }

    @Column(name = "TRADE_CODE")
    public String getTradeCode() {
        return tradeCode;
    }

    public void setTradeCode(String tradeCode) {
        this.tradeCode = tradeCode;
    }

    @Column(name = "TRADE_DESC")
    public String getTradeDesc() {
        return tradeDesc;
    }

    public void setTradeDesc(String tradeDesc) {
        this.tradeDesc = tradeDesc;
    }

    @Column(name = "RESTORE_NEEDED")
    public String getRestoreNeeded() {
        return restoreNeeded;
    }

    public void setRestoreNeeded(String restoreNeeded) {
        this.restoreNeeded = restoreNeeded;
    }

    @Column(name = "RETURN_CODE")
    public String getReturn_code() {
        return return_code;
    }

    public void setReturn_code(String return_code) {
        this.return_code = return_code;
    }

    @Column(name = "RETURN_INFO")
    public String getReturn_info() {
        return return_info;
    }

    public void setReturn_info(String return_info) {
        this.return_info = return_info;
    }

    @Column(name = "RCPM_NO")
    public String getRcpm_no() {
        return rcpm_no;
    }

    public void setRcpm_no(String rcpm_no) {
        this.rcpm_no = rcpm_no;
    }

    @Column(name = "FIMS_NO")
    public String getFims_no() {
        return fims_no;
    }

    public void setFims_no(String fims_no) {
        this.fims_no = fims_no;
    }

    @Column(name = "BANK_BUS_NO")
    public String getBank_bus_no() {
        return bank_bus_no;
    }

    public void setBank_bus_no(String bank_bus_no) {
        this.bank_bus_no = bank_bus_no;
    }

    @Column(name = "BANK_HANDLING")
    public BigDecimal getBank_handling() {
        return bank_handling;
    }

    public void setBank_handling(BigDecimal bank_handling) {
        this.bank_handling = bank_handling;
    }

    @Column(name = "BANK_TELEGRAM")
    public BigDecimal getBank_telegram() {
        return bank_telegram;
    }

    public void setBank_telegram(BigDecimal bank_telegram) {
        this.bank_telegram = bank_telegram;
    }

    @Column(name = "REPORT_DATE")
    public String getReport_date() {
        return report_date;
    }

    public void setReport_date(String report_date) {
        this.report_date = report_date;
    }

    @Column(name = "BANK_PAYAMT")
    public BigDecimal getBank_payamt() {
        return bank_payamt;
    }

    public void setBank_payamt(BigDecimal bank_payamt) {
        this.bank_payamt = bank_payamt;
    }

    @Column(name = "BANK_EXCHANGERATE")
    public BigDecimal getBank_exchangerate() {
        return bank_exchangerate;
    }

    public void setBank_exchangerate(BigDecimal bank_exchangerate) {
        this.bank_exchangerate = bank_exchangerate;
    }

    @Column(name = "ORDER_MESSAGE_ID")
    public int getOrderMessageId() {
        return orderMessageId;
    }

    public void setOrderMessageId(int orderMessageId) {
        this.orderMessageId = orderMessageId;
    }

    @Column(name = "STATE")
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Column(name = "CREATE_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "LAST_UPDATE_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public void setCreateDate() {
        this.createTime = new Date();
        this.lastUpdateTime = createTime;
    }

}
